<template id="newp">
    <div>
        <div class="buy_newp">
            <div class="bi_buy_newp">
                <h1>
                    <div class="new_1"><img class='img_newp' src="../image/x_left.png" alt=""></div>
                    <span class="new_3">{{tag1_ad.title}}</span>
                    <div class="new_2"><img class="img_1_newp" src="../image/x_right.png" alt=""></div>
                </h1>
                <p>新品上市 优惠美味你知道</p>
            </div>

            <div class="tag_1">
                <div class="orange_newp" id="orange_banner">
                    <img  v-lazy="tag1_ad.url" alt="">
                </div>
                <div class="orange_list_newp">
                    <dl v-for="n in tag1_list">
                        <dt>
                            <img class='img_11'  v-lazy="n.thumb" alt="" @click="getBuy(n.id)">
                        </dt>
                        <dd>{{n.name}}</dd>
                        <dd><span>{{n.shop_price}}<time>{{n.goods_share}}</time></span><img src="../image/add.jpg" alt="" @click="addCart(n.id,n.thumb)"></dd>
                    </dl>
                   
                </div>
            </div>

            <div class="tag_2">
                <div class="orange_newp" id="orange_banner2">
                    <img :src="tag2_ad.url" alt="">
                </div>
                <div class="orange_list_newp">
                    <dl v-for="n in tag2_list">
                        <dt>
                            <img class='img_11'  v-lazy="n.thumb" alt="" @click="getBuy(n.id)">
                        </dt>
                        <dd>{{n.name}}</dd>
                        <dd><span>{{n.shop_price}}<time>{{n.goods_share}}</time></span><img src="../image/add.jpg" alt="" @click="addCart(n.id,n.thumb)"></dd>
                    </dl>
                   
                </div>
            </div>

            <div class="tag_3">
                <div class="orange_newp" id="orange_banner1">
                    <img :src="tag3_ad.url" alt="">
                </div>
                <div class="orange_list_newp">
                    <dl v-for="n in tag3_list">
                        <dt>
                            <img class='img_11'  v-lazy="n.thumb" alt="" @click="getBuy(n.id)">
                        </dt>
                        <dd>{{n.name}}</dd>
                        <dd><span>{{n.shop_price}}<time>{{n.goods_share}}</time></span><img src="../image/add.jpg" alt="" @click="addCart(n.id,n.thumb)"></dd>
                    </dl>
                   
                </div>

            </div>



        </div>
    </div>
</template>
<script>
    export default {
        name :'newp',
        data(){
            return{
                /*   id:this.$route.query.this.ma.id,*/
                tag1_ad:[],
                tag1_list:[],
                tag2_ad:[],
                tag2_list:[],
                tag3_ad:[],
                tag3_list:[]
            }
        },
        mounted:function(){
            let mode1 = 'three';
            this.GLOBAL.getList(this,mode1,1);

            let mode2 = 'four';
            this.GLOBAL.getList(this,mode2,2);

            let mode3 = 'five';
            this.GLOBAL.getList(this,mode3,3);
        },
        methods:{
            getBuy:function(id){
                this.$router.push('/shopDetails?goods_id=' + id);
            },
			addCart:function (goods_id,image, number = 1) {
				this.GLOBAL.addCart(this,goods_id,number);
                this.GLOBAL.get_te(image);
			}
        }
    }
</script>
<style>
    .orange_list_newp{
        height:2.20rem;
        width:100%;
        display:flex;
        /*flex-wrap: wrap;*/
        justify-content:flex-start;
        margin-bottom:0.3rem;
    }
    .orange_list_newp dl{
        height:2.20rem;
        width:2.11rem;
        /*flex:1;*/
    }
    .orange_list_newp dl dt{
        height:1.54rem;
        width:2.11rem;
        position:relative;

    }
    .orange_list_newp dl dd:nth-of-type(1){
        height:0.46rem;
        width:2.11rem;
        color:#333;
        font-size:0.2rem;
        text-indent: 0.3rem;
        line-height:0.46rem;
        overflow: hidden; /*自动隐藏文字*/
        text-overflow: ellipsis;/*文字隐藏后添加省略号*/
        white-space: nowrap;/*强制不换行*/
    }
    .orange_list_newp dl dd:nth-of-type(2){
        width:2.11rem;
        height:0.46rem;
        position: relative;
    }
    .orange_list_newp dl dd:nth-of-type(2) span{
        color:#ff7e67;
        font-size:0.18rem;
        display:block;
        text-indent: 0.3rem;
        width: 2.5rem;
    }
    .orange_list_newp dl dd:nth-of-type(2) img{
        display:block;
        height:0.23rem;
        width:0.23rem;
        position:absolute;
        top:-0.01rem;
        left:1.68rem;
    }
    .orange_list_newp dl dt img{
        height:1.54rem;
        width:1.54rem;
        display:block;
        position:absolute;
        left:0.35rem;
    }
    .buy_newp{
        min-height: 18rem;
        width:100%;
        border-bottom:10px solid #f5f4f2;
    }
    .bi_buy_newp{
        margin:0.4rem 0;
        width:100%;
        height:0.42rem;
    }
     .bi_buy_newp h1{
       /* font-size:0.28rem;*/
        color: #4a4a4a;
        line-height:0.42rem;
       /* text-align:center;*/
        width:100%;
       /* position: relative;*/
        height:0.42rem;
         display:flex;
    }
     #orange_banner{
         position:relative;
     }
    #orange_banner img{
        position:absolute;
        top:0;
        left:0;
    }
    #orange_banner1{
        position:relative;
    }
    #orange_banner1 img{
        position:absolute;
        top:0;
        left:0;
    }
    #orange_banner2{
        position:relative;
    }
    #orange_banner2 img{
        position:absolute;
        top:0;
        left:0;
    }
    .buy_newp img{
        display:block;
        width:1.8rem;
        height:0.3rem;
       /* position:absolute;*/
    }
    .new_1{
        flex:1;
        height:0.3rem;
    }
    .new_2{
        flex:1;
        height:0.3rem;
    }
    .new_3{
        display:block;
        font-size: 0.32rem;
        color: #4a4a4a;
        line-height: 0.3rem;
        width:auto;
        text-align:center;
    }
   .new_1 img{
        /*top:0;
        left:0.2rem;*/
       display:block;
       height:0.3rem;
       width:1.8rem;
       float:right;
    }
    .new_2 img{
        display:block;
        height:0.3rem;
        width:1.8rem;
        float:left;
        /*top:0;
        right:0.2rem;*/
    }
    .buy_newp p{
        height:0.5rem;
        line-height:0.3rem;
        text-align:center;
        color:#afafaf;
        font-size:0.22rem;
    }
    .orange_newp{
        height:2.8rem;
        width:100%;
        margin-bottom:0.3rem;
    }
    .orange_newp img{
        height:2.8rem;
        width:100%;
        display:inline-block;
    }
</style>
